﻿<%@ Page Title="" Language="C#" MasterPageFile="~/HomePage.master" AutoEventWireup="true"
    CodeFile="ListTour.aspx.cs" Inherits="Tour_ListTour" %>

<%@ Register Assembly="PagerControl" Namespace="CutePager" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>
        <asp:Literal ID="ltrTitle" runat="server"></asp:Literal>
        <%= Common.title %></title>
    <!-- CSS -->
    <style type="text/css">
        /* wrapper */
        #boxes
        {
            font-size: 12px;
            clear: both; /*border: 1px solid red;*/
            padding: 10px;
        }
        
        /* Header danh sách Tour */
        #iconTop p#headertour
        {
            padding: 5px 0px 0px 10px;
            color: white;
            font-weight: bold;
            width: 100%;
            height: 25px;
            background: transparent url(http://www.vyctour.com/Images/dltn/dstour.png) no-repeat;
            margin-bottom: 5px;
        }
        
        /* Header cua gridview */
        .headerstyle
        {
            color: white;
            background: url(http://www.vyctour.com/Images/dltn/bgheader.png) repeat;
            height: 30px;
            border-bottom: 4px solid #F6202A;
            padding: 100px 0px 30px 0px;
        }
        
        .hidden
        {
            display: none;
        }
        /* Khung bao quanh tiêu đề và Tooltip */
        div#nav
        {
            position: relative;
            margin: 5px;
        }
        
        /* Khung bao quanh Tooltip */
        div#boxes div#nav p
        {
            padding: 5px;
            margin: 0px;
            text-align: justify;
            border: 1px solid yellow;
            width: 250px;
            height: auto;
            border-radius: 5px;
            color: black;
        }
        
        /* Ảnh hiển thị trong Tooltip */
        div#boxes div div#nav p .zoomImage
        {
            width: 100%;
            height: 180px;
            margin-bottom: 5px;
        }
        
        /* Link tiêu đề của điểm đến */
        div#boxes div#nav a.linktieude
        {
            text-decoration: none;
            color: black;
        }
        
        div#boxes div#nav a.linktieude:hover
        {
            color: red;
        }
        
        .chitiet
        {
            float: right;
            color: red;
            margin-right: 5px;
            padding: 5px 10px 0px 0px;
        }
        
        .linkdattour
        {
            clear: both;
            float: right;
            font-size: 12px;
            border-radius: 8px;
            font-weight: bold;
            background: red url(Images/dltn/bgheader.png) repeat;
            color: white;
            cursor: pointer;
            text-align: center;
            margin: 0px;
            z-index: 1;
        }
    </style>
    <!-- Include Script -->
    <script src="Scripts/jquery-1.1.3.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            // Xử lý khi chuột di chuyển
            $('div#nav a').mousemove(
                function (e) {
                    var el = $(this);
                    $(this).next()
                        .css(
                            {
                                display: 'inline-block',
                                position: 'absolute',
                                left: e.pageX - el.offset().left + 50,
                                top: e.pageY - el.offset().top - 50,
                                background: 'pink',
                                'z-index': '1',
                            }
                        ).stop();
                }
            );

            // Xử lý khi chuột ra ngoài
            $('div#nav a').mouseleave(
                function () {
                    $(this).next().css({ display: 'none' }).stop();
                }
            );
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div id="border">
        <asp:Panel ID="pnTour" runat="server">
            <div id="iconTop">
                <p id="headertour">
                    DANH SÁCH TOUR
                </p>
            </div>
            <p class="msg">
                <asp:Literal ID="ltrMessage" runat="server" Visible="true"></asp:Literal></p>
            <%
                if (ltrMessage.Visible == true)
                {    
            %>
            <div id="boxes" style="border: none;">
            </div>
            <%  }
                else
                { %>
            <div id="boxes">
                <div style="border: 1px solid red">
                    <asp:GridView ID="grdGridView" runat="server" BorderColor="White" BorderWidth="1px"
                        AutoGenerateColumns="False" EnableModelValidation="True" EmptyDataText="<br><center>Không tồn tại dữ liệu</center><br>"
                        Width="100%" Font-Bold="True" OnRowCommand="grdGridView_RowCommand">
                        <HeaderStyle CssClass="headerstyle" />
                        <Columns>
                            <asp:TemplateField HeaderText="Mã Tour" ItemStyle-Width="150">
                                <ItemTemplate>
                                    <%# Eval("Id") %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Điểm đến">
                                <ItemTemplate>
                                    <div id="nav">
                                        <asp:HyperLink CssClass="linktieude" runat="server" NavigateUrl='<%# "~/" + "Tour/" + Eval("Id") + "/" + Eval("IdSubTour") + "/" + GetTieuDe(Eval("TieuDe")) + ".aspx" %>'><%# Eval("TieuDe") %></asp:HyperLink>
                                        <%--<a id="linktieude" href='<%# "~/" + "Tour/" + Eval("Id") + "/" + Eval("IdSubTour") + "/" + GetTieuDe(Eval("TieuDe")) + ".aspx" %>'>
                                            <%# Eval("TieuDe") %>
                                        </a>--%>
                                        <p class="hidden">
                                            <asp:Image ID="Image1" CssClass="zoomImage" ImageUrl='<%# "~/Upload/Tour/" + Eval("AnhDaiDien")%>'
                                                runat="server" />
                                            <%# Eval("TomTat") %>
                                        </p>
                                    </div>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Số ngày">
                                <ItemTemplate>
                                    <%# this.TruNgay(Eval("NgayVe").ToString(),Eval("NgayDi").ToString()) %>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Ngày đi">
                                <ItemTemplate>
                                    <%# Convert.ToDateTime(Eval("NgayDi")).ToString("dd/MM/yyyy")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Ngày về">
                                <ItemTemplate>
                                    <%# Convert.ToDateTime(Eval("NgayVe")).ToString("dd/MM/yyyy")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Giá (VNĐ)">
                                <ItemTemplate>
                                    <b><font color="red">
                                        <%# String.Format("{0:###,###,##0}",Eval("GiaTour"))%></font></b>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Giờ đi">
                                <ItemTemplate>
                                    <%# Eval("GioDi") %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Giờ đến">
                                <ItemTemplate>
                                    <%# Eval("GioDen") %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Số chỗ còn nhận" ItemStyle-Width="70">
                                <ItemTemplate>
                                    <b><font color="red">
                                        <%# Eval("SoCho") %></font></b>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="" ItemStyle-Width="70">
                                <ItemTemplate>
                                    <asp:HyperLink ID="linkchitiet" CssClass="chitiet" NavigateUrl='<%# "~/" + "Tour/" + Eval("Id") + "/" + Eval("IdSubTour") + "/" + GetTieuDe(Eval("TieuDe")) + ".aspx" %>'
                                        runat="server">Chi Tiết</asp:HyperLink>
                                    <asp:Button ID="Button1" runat="server" CssClass="linkdattour" CommandName="cmdDatTour"
                                        CommandArgument='<%# Eval("Id") %>' Text="Đặt Tour" Height="25px" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <RowStyle Font-Bold="False" ForeColor="Black" HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:GridView>
                </div>
                <div style="clear: both; margin: 0px">
                </div>
                <div style="float: right; padding-top: 10px;">
                    <cc1:Pager ID="Pager1" runat="server" PreviousClause="Lùi" NextClause=" Tiếp " LastClause=""
                        FirstClause="" PageClause="Trang " OfClause="/" PageSize="10" OnCommand="Pager1_Command"
                        ForeColor="#006600" Font-Bold="True" />
                </div>
            </div>
            <!-- End #wrapper -->
            <%} %>
        </asp:Panel>
        <div style="clear: both; margin: 0px">
        </div>
        <asp:Panel ID="pnchuyenmuc" runat="server">
            <%--DESIGN CHO KẾT QUẢ TÌM KIẾM CHUYÊN MỤC--%>
            <div id="ket-qua-chuyen-muc">
                <div id="ket-qua-header">
                    <h2>
                        Kết quả tìm kiếm chuyên mục</h2>
                </div>
                <asp:DataList ID="dlBaiViet" runat="server" RepeatColumns="1" RepeatDirection="Horizontal"
                    Width="100%" RepeatLayout="Flow">
                    <ItemTemplate>
                        <div class="ket-qua-item">
                            <div class="ket-qua-left">
                                <asp:HyperLink runat="server" ID="linkkq01" NavigateUrl='<%# "~/" + "ChuyenMuc/" + Eval("Id") + "/" + Eval("IdSubChuyenMuc")  + "/" + GetTieuDe(Eval("TieuDe")) + ".aspx" %>'>
                                    <asp:Image ID="Image2" Width="150px" Height="110px" runat="server" ImageUrl='<%# "~/Upload/ChuyenMuc/" + Eval("AnhDaiDien") %>' />
                                </asp:HyperLink>
                            </div>
                            <div class="ket-qua-right">
                                <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl='<%# "~/" + "ChuyenMuc/" + Eval("Id") + "/" + Eval("IdSubChuyenMuc")  + "/" + GetTieuDe(Eval("TieuDe")) + ".aspx" %>'>
                                    <%# Eval("TieuDe") %>
                                    <i>
                                        <%# Convert.ToDateTime(Eval("NgayCapNhat")).ToString("dd/MM/yyyy") %></i></asp:HyperLink><br />
                                <font style="line-height: 180%;">
                                    <%# Eval("TomTat") %></font>
                            </div>
                        </div>
                        <div style="margin: 0px; clear: both;">
                        </div>
                        <br />
                    </ItemTemplate>
                </asp:DataList>
                <div style="clear: both; margin: 0px">
                </div>
                <div style="float: right; padding-top: 10px;">
                    <cc1:Pager ID="Pager2" runat="server" PreviousClause="Lùi" NextClause=" Tiếp " LastClause=""
                        FirstClause="" PageClause="Trang " OfClause="/" PageSize="2" OnCommand="Pager2_Command"
                        ForeColor="#006600" Font-Bold="True" />
                </div>
            </div>
        </asp:Panel>
        <%--Kết thúc tìm kiếm chuyên mục--%>
        <div id="Right">
        </div>
        <div style="clear: both">
        </div>
    </div>
</asp:Content>
